import { createStore, combineReducers } from 'redux';

import {
    CHANGE_HOME_INDEX,
    NAV_TO_LOGIN
} from './action/action';


function navToLogin(state = false, action) {
    switch (action.type) {
        case NAV_TO_LOGIN:
            return action.status
        default:
            return state
    }
}

function homeIndex(state = 1, action) {
    switch (action.type) {
        case CHANGE_HOME_INDEX:
            return action.index
        default:
            return state
    }
}

let store = createStore(combineReducers({ navToLogin, homeIndex }));

export default store;
